export const StationType = [{
		label: "居民区",
		prop: "1"
	},
	{
		label: "公共机构",
		prop: "2"
	},
	{
		label: "企事业单位",
		prop: "3"
	},
	{
		label: "写字楼",
		prop: "4"
	},
	{
		label: "工业园区",
		prop: "5"
	},
	{
		label: "交通枢纽",
		prop: "6"
	},
	{
		label: "大型文体设施",
		prop: "7"
	},
	{
		label: "城市绿地",
		prop: "8"
	},
	{
		label: "大型建筑配建停车场",
		prop: "9"
	},
	{
		label: "路边停车位",
		prop: "10"
	},
	{
		label: "城际高速服务区",
		prop: "11"
	},
	{
		label: "其他",
		prop: "255"
	},
]
export const OperatorID = async () => {

}
export const pt = ["免费WIFI", "空调休息室", "按摩室", "便利店", "洗车", "饮用水", "卫生间", "餐馆", "自动售货机", "地锁"]
export const gzt = [{
		label: '离线',
		prop: '0'
	},
	{
		label: '在线',
		prop: '1'
	},
	{
		label: '故障',
		prop: '2'
	},
	{
		label: '断电',
		prop: '3'
	},
	{
		label: '未上线',
		prop: '9'
	},
]
export const gztdt = [{
		label: '离线',
		prop: '0'
	},
	{
		label: '在线',
		prop: '1'
	},

	{
		label: '未上线',
		prop: '9'
	},
]
export const type = [
	// {
	//   label: '免费',
	//   prop: '0',
	// },
	{
		label: '电量计费',
		prop: '1',
	},
	{
		label: '阶梯电量',
		prop: '12',
	},
	{
		label: '地锁阶梯电量计费',
		prop: '14',
	},
	// {
	//   label: '固定计费',
	//   prop: '2',
	// },
	// {
	//   label: '阶梯计费',
	//   prop: '3',
	// },
	// {
	//   label: '起步模式',
	//   prop: '4',
	// },
	// {
	//   label: '小时模式',
	//   prop: '5',
	// },
	// {
	//   label: '小时阶梯模式',
	//   prop: '6',
	// },
	// {
	//   label: '小时退费',
	//   prop: '7',
	// },
	// {
	//   label: '阶梯退费',
	//   prop: '8',
	// },
	// {
	//   label: '阶梯金额',
	//   prop: '9',
	// },
	// {
	//   label: '服务费按时间',
	//   prop: '10',
	// },
	// {
	//   label: '服务费按电量',
	//   prop: '15',
	// },
]

// const elctype = [0, 1, 5, 6, 7, 8, 11, 12, 101, 3]
// const qcctype = [2, 10, 4, 61, 62]
// const cdgctype = [51]
// const gtype = [
//   { label: '二轮充电桩', prop: `gtype in (${elctype.toString()})` },
//   { label: '汽车充电桩', prop: `gtype in (${qcctype.toString()})` },
//   { label: '充电柜', prop: `gtype in (${cdgctype.toString()})` },
// ]
const gtype = [{
		label: '普通充电桩',
		prop: '0',
		add: 1
	},
	{
		label: '不定路数电瓶车充电桩',
		prop: '1'
	},
	{
		label: '汽车充电桩',
		prop: '2',
		add: 1
	},
	{
		label: 'IC卡充值设备',
		prop: '5',
		add: 1
	},
	{
		label: '电瓶车充电桩(4G)',
		prop: '6'
	},
	{
		label: '电瓶车充电桩(BN)',
		prop: '7'
	},
	{
		label: '电瓶车充电桩(网卡)',
		prop: '8'
	},
	{
		label: '大功率充电桩',
		prop: '11',
		add: 1
	},
	{
		label: '直流快充设备',
		prop: '12',
		add: 1
	},
	{
		label: '网关型设备',
		prop: '101',
		add: 1
	},
	{
		label: '无线充电桩',
		prop: '70',
		add: 1
	},
	{
		label: '充电柜',
		prop: '51',
		add: 1
	},
	{
		label: '带道闸汽车桩',
		prop: '52',
		add: 1
	},
	{
		label: '学院一卡通设备',
		prop: '10',
		add: 1
	},
	{
		label: '超翔设备',
		prop: '3',
		add: 1
	},
	{
		label: '澳能汽车充电桩',
		prop: '4',
		add: 1
	},
	{
		label: '汽车充电桩(瑞)',
		value: '61',
		add: 1
	},
	{
		label: '汽车充电桩(云)',
		value: '62',
		add: 1
	},
	{
		label: 'OCPP协议',
		prop: '63',
		add: 1
	},
	{
		label: '地锁控制箱',
		prop: '20',
		add: 1
	},
]
const pp = [{
	label: '臻万科技',
	prop: '臻万科技'
}, ]
export const gyg = [{
		label: '正常',
		value: '0',
	},
	{
		label: '报警',
		value: '1',
	},
	{
		label: '故障',
		value: '2',
	},
	{
		label: '未启用',
		value: '3',
	},
]
const glzt = [{
		label: '空闲',
		value: '0',
	},
	{
		label: '被占用',
		value: '1',
	},
	{
		label: '故障',
		value: '2',
	},
	{
		label: '隐藏',
		value: '3',
	},
]
const isqc = function(ChargeCar) {
	if (
		ChargeCar['gtype'] == '62' ||
		ChargeCar['gtype'] == '61' ||
		ChargeCar['type'] == '14'
	) {
		return true
	}
	if (ChargeCar['gtype'] == '2' && ChargeCar['gcdl5'] == '1') {
		return true
	}
	return false
}
const b_use = [{
		label: '设备不支持扫码充电',
		value: '0',
	},
	{
		label: '正常使用',
		value: '1',
	},
	{
		label: '系统升级中',
		value: '2',
	},
	{
		label: '设备故障',
		value: '3',
	},
	{
		label: '只支持微信',
		value: '4',
	},
	{
		label: '只支持支付宝',
		value: '5',
	},
	{
		label: '只支持余额支付',
		value: '6',
	},
]
const utype = [{
		value: '0',
		label: '代理商'
	},
	{
		value: '1',
		label: '安装员'
	},
	// { value: '7', label: '查看员' },
	// { value: '2', label: '办卡人员' },
	// { value: '9', label: '财务人员' },
	// { value: '10', label: '商家' },
	// { value: '14', label: '自助注册用户' },
	// { value: '15', label: '维护账户' },
	// { value: '22', label: '维修查看员' },
	// { value: '18', label: '自定义用户' },
	// { value: '19', label: '合作伙伴' },
	// { value: '20', label: '物业' },
	// { value: '21', label: '优惠卡管理员' },
]
export function typeudjfn(data, zdata = {}) {
	let r = []
	if (
		['11', '12', '7', '15'].find((e) => {
			return e == data.utype
		})
	) {
		r = [{
				value: '0',
				label: '超级用户'
			},
			{
				value: '1',
				label: '一级用户'
			},
			{
				value: '2',
				label: '二级用户'
			},
		]
	}
	if (
		['0', '3'].find((e) => {
			return e == data.utype
		})
	) {
		r = [{
				value: '0',
				label: '超级用户'
			},
			{
				value: '1',
				label: '一级用户'
			},
			{
				value: '2',
				label: '二级用户'
			},
			{
				value: '3',
				label: '三级用户'
			},
		]
	}


	return r
}

const UPWutypes = ['0', '12', '18', '19', '20', '4', '3']

const b_askb_dlcallback = async function(data, datas = []) {

}

const cdtype = [{
		label: '免费',
		value: '0',
		icon: 'icon-saoma1'
	},
	{
		label: '电量计费',
		value: '1',
		icon: 'icon-saoma1'
	},
	{
		label: '固定计费',
		value: '2',
		icon: 'icon-saoma1'
	},
	{
		label: '电量计费刷卡用户',
		value: '3',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '固定计费刷卡用户',
		value: '4',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '阶梯计费',
		value: '5',
		icon: 'icon-saoma1'
	},
	{
		label: '次卡刷卡',
		value: '6',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '阶梯计费刷卡用户',
		value: '7',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '起步计费',
		value: '8',
		icon: 'icon-saoma1'
	},
	{
		label: '起步计费刷卡用户',
		value: '9',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '按小时收费',
		value: '10',
		icon: 'icon-saoma1'
	},
	{
		label: '按小时收费刷卡用户',
		value: '11',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '按小时阶梯收费',
		value: '12',
		icon: 'icon-saoma1'
	},
	{
		label: '按小时阶梯收费刷卡用户',
		value: '13',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '小时退费模式',
		value: '14',
		icon: 'icon-saoma1'
	},
	{
		label: '小时退费模式刷卡用户',
		value: '15',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '阶梯退费模式',
		value: '16',
		icon: 'icon-saoma1'
	},
	{
		label: '阶梯退费模式刷卡用户',
		value: '17',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '阶梯金额模式',
		value: '18',
		icon: 'icon-saoma1'
	},
	{
		label: '阶梯金额模式刷卡用户',
		value: '19',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '用户购买优惠包月模式',
		value: '20',
		icon: 'icon-saoma1'
	},
	{
		label: '用户购买优惠包年模式',
		value: '21',
		icon: 'icon-saoma1'
	},
	{
		label: '服务费计费用户',
		value: '22',
		icon: 'icon-saoma1'
	},
	{
		label: '服务费计费刷卡',
		value: '23',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '投币用户',
		value: '24',
		icon: 'icon-yiyuanqitou'
	},
	{
		label: '云闪付',
		value: '26',
		icon: 'icon-yunshanfu'
	},
	{
		label: '时间月卡支付',
		value: '27',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '离线模式充电',
		value: '28',
		icon: 'icon-saoma1'
	},
	{
		label: '充电桩租置模式',
		value: '29',
		icon: 'icon-saoma1'
	},
	{
		label: '充电桩租置模式卡支付',
		value: '30',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '汽车桩电量包模式',
		value: '31',
		icon: 'icon-saoma1'
	},
	{
		label: '汽车桩电量模式刷卡',
		value: '32',
		icon: 'icon-SKJYJCTJ'
	},
	{
		label: '电量包计费',
		value: '33',
		icon: 'icon-saoma1'
	},
	{
		label: '带道闸阶梯电量模式',
		value: '34',
		icon: 'icon-saoma1'
	},
]
const qyzt = [{
		label: '禁用',
		value: '0'
	},
	{
		label: '正常',
		value: '1'
	},
]
const GetRfUserutype = [{
		label: '微信用户',
		value: '5'
	},
	{
		label: '支付宝用户',
		value: '6'
	},
	{
		label: '刷卡用户',
		value: '7'
	},
	{
		label: '次卡用户',
		value: '8'
	},
	{
		label: '小程序用户',
		value: '101'
	},
]
const cardtype = [{
		label: '消费卡',
		value: '0',
		dw: '元',
		fl: '100'
	},
	{
		label: '次数卡',
		value: '1',
		dw: '次'
	},
	{
		label: '站点消费卡',
		value: '2',
		dw: '元',
		fl: '100'
	},
	{
		label: '月卡(整月)',
		value: '3',
		dw: '月'
	},
	{
		label: '月卡',
		value: '4',
		dw: '月'
	},
	{
		label: '时间月卡',
		value: '5',
		dw: '小时',
		fl: '60'
	},
	{
		label: '到期卡',
		value: '6',
		dw: '次/日'
	},
]
const yxq = [{
		label: '按充值时间到期',
		value: '0',
	},
	{
		label: '按月底到期',
		value: '1',
	},
	{
		label: '按激活时间到期',
		value: '2',
	},
]

const cardjecallback = function(data) {
	const type = cardtype.find((e) => {
		return e.value == data.type
	})
	if (type) {
		let r = data.je
		if (type.fl) {
			r = data.je / type.fl
			r = type.fl == 100 ? r.toFixed(2) : r.toFixed(1)
		}
		return r + type.dw
	} else {
		return ''
	}
}
const xtype = [{
		label: '直流充电桩',
		value: '8'
	},
	{
		label: '交流充电桩',
		value: '9'
	},
	{
		label: '分体式充电桩',
		value: '10'
	},
]
const xtypelx = function(type) {
	const r = xtype.find(e => {
		return e.value == type
	})
	return r ? r.label : "交流充电桩"
}
const df1 = [{
		label: '750V/1000V',
		value: '0',
	},
	{
		label: '220V',
		value: '1',
	}
]
const df2 = [{
		label: '7KW',
		value: '0',
	},
	{
		label: '14KW',
		value: '1',
	},
	{
		label: '21KW',
		value: '4',
	},
	{
		label: '60KW',
		value: '5',
	},
	{
		label: '120KW',
		value: '2',
	},
	{
		label: '240KW',
		value: '3',
	},
	{
		label: '600KW',
		value: '6',
	}
]
let r = {
	df1,
	df2,
	xtype,
	xtypelx,
	cardjecallback,
	yxq,
	cardtype,
	GetRfUserutype,
	qyzt,
	cdtype,
	b_askb_dlcallback,
	OperatorID,
	UPWutypes,
	typeudjfn,
	gztdt,
	utype,
	b_use,
	isqc,
	glzt,
	pp,
	StationType,
	pt,
	gzt,
	type,
	gtype,
	gyg
}
const getoption = (value, prop) => {
	if (!r[prop]) {
		return value
	}
	let option = r[prop].find(e => {
		return e.value == value
	})
	return option ? option.label : value
}
r.getoption = getoption;
export default r